Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(prometheus/test): replace deprecated test application context initializer class during upgrade to spring boot 2.6.x #1015

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

j-sandy
Copy link
Contributor

@j-sandy j-sandy commented Jan 12, 2024

While upgrading spring boot 2.6.15 and spring cloud 2021.0.8, encounter below error in kayenta-prometheus module during test compilation:

> Task :kayenta-prometheus:compileTestJava FAILED
/kayenta/kayenta-prometheus/src/test/java/com/netflix/kayenta/prometheus/config/PrometheusHealthConfigurationTest.java:28: error: cannot find symbol
import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer;
                                            ^
  symbol:   class ConfigFileApplicationContextInitializer
  location: package org.springframework.boot.test.context
1 error

The root cause is the removal of ConfigFileApplicationContextInitializer class which got deprecated since spring boot 2.4.x in favour of ConfigDataApplicationContextInitializer class from spring boot 2.6.x. To fix this issue replacing the deprecated class with new class.

…t initializer class during upgrade to spring boot 2.6.x

While upgrading spring boot 2.6.15 and spring cloud 2021.0.8, encounter below error in kayenta-prometheus module during test compilation:
```
> Task :kayenta-prometheus:compileTestJava FAILED
/kayenta/kayenta-prometheus/src/test/java/com/netflix/kayenta/prometheus/config/PrometheusHealthConfigurationTest.java:28: error: cannot find symbol
import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer;
                                            ^
  symbol:   class ConfigFileApplicationContextInitializer
  location: package org.springframework.boot.test.context
1 error
```
The root cause is the removal of `ConfigFileApplicationContextInitializer` class which got deprecated since [spring boot 2.4.x](https://javadoc.io/doc/org.springframework.boot/spring-boot-test/2.4.4/deprecated-list.html) in favour of `ConfigDataApplicationContextInitializer` class from [spring boot 2.6.x](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.6-Release-Notes#deprecations-from-spring-boot-24).
To fix this issue replacing the deprecated class with new class.
@dbyron-sf dbyron-sf added the ready to merge Reviewed and ready for merge label Jan 12, 2024
@mergify mergify bot added the auto merged label Jan 12, 2024
@mergify mergify bot merged commit ae9d112 into spinnaker:master Jan 12, 2024
10 checks passed
@j-sandy j-sandy deleted the config-initializer-update branch January 16, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants